import ApiComm from '../ApiComm'
import { doDownLoadFile } from '@/libs/tools'

export default {
  downLoadFile: (id) => {
    doDownLoadFile(ApiComm.$store.state.app.appInfo.baseURL + '/workflow/definition/file/' + id)
  },
  delete: (ids) => {
    return ApiComm.$http.delete('/workflow/definition', {
      data: ids
    })
  },
  create: (info) => {
    return ApiComm.$http.put('/workflow/definition', info)
  },
  update: (info) => {
    return ApiComm.$http.patch('/workflow/definition', info)
  },
  query: (query) => {
    return ApiComm.$http.post('/workflow/definition', query)
  },
  deploy: (id) => {
    return ApiComm.$http.put('/workflow/definition/deploy/' + id)
  }
}
